import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {PagesComponent} from './pages.component';
import {RouteActivateChild} from '../core/auth/route.activate.child';
import {LoginActivate} from '../core/auth/login.activate';
import {HomeComponent} from './home/home.component';
import {PersonalCenterComponent} from './personal-center/personal-center.component';

const routes: Routes = [
    {
        path: 'pages', component: PagesComponent,
        children: [
            {
                path: 'home',
                component: HomeComponent,
                data: {
                    breadcrumb: '首页'
                },
                canActivate: [LoginActivate]
            },
            {
                path: 'personal-center',
                component: PersonalCenterComponent,
                data: {
                    breadcrumb: '个人中心'
                },
                canActivate: [LoginActivate]
            },
            {
                path: 'plat', loadChildren: './plat-manage/plat-manage.module#PlatManageModule',
                canActivateChild: [RouteActivateChild]
            },
          {
            path: 'evalute', loadChildren: './evalute-system/evalute-system.module#EvaluteSystemModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'evaluate-statistics', loadChildren: './evaluate-statistics/evaluate-statistics.module#EvaluateStatisticsModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'statistical-analysis', loadChildren: './statistical-analysis/statistical-analysis.module#StatisticalAnalysisModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'my-waitdeal', loadChildren: './my-waitdeal/my-waitdeal.module#MyWaitdealModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'system-manage', loadChildren: './system-manage/system-manage.module#SystemManageModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'stu-page',
            loadChildren: './stu-page/stu-page.module#StuPageModule',
            canActivateChild: [RouteActivateChild]
          },
          {
            path: 'supervision-page',
            loadChildren: './supervision-page/supervision-page.module#SupervisionPageModule',
            canActivateChild: [RouteActivateChild]
          },
            {path: '', redirectTo: 'home', pathMatch: 'full'},
            {path: '**', redirectTo: 'home'}
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class PagesRoutingModule {
}
